<script type="text/javascript">
$(function(){
	$.get("printCredentials/getPDFInfo",function(data){
			var fileName = data.credentialNo+"_print.pdf";
			console.log("fileName==>"+fileName);
			var path = data.ipAddress;
			console.log("path==>"+path);
			var html_pdf = '<object data ="'+path+fileName+'" type="application/pdf" width="100%" height="95%">'
				+'<iframe src="'+path+fileName+'" width="100%" height="95%" style="border: none;">'
				+'This browser does not support PDFs. Please download the PDF to view '
				+'it: <a href="">Download PDF</a>'
				+'</iframe>'
				+'</object>';  
			$("#storagePdfView").append(html_pdf);
	},"json");
	
	$("#printCredential").click(function(){
		$.ajax({
			type: 'POST',
			url: 'printCredentials/printCredentialPDF',
			data: {"fileName":fileName},
			//data: radio_json,
			dataType: "json",
			cache: false
		});
	});
	//location.reload();

})
</script>
<div class="pageContent">
	<form method="post" action="demo/common/ajaxDone.html" class="pageForm">
	<div class="pageFormContent" layoutH="56">
		<div id="storagePdfView" layout="56" style="height:500px">
		</div>
	</div>
	</form>
</div>